#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
@File    :   Style.py
@Time    :   2019/05/03 07:34:03
@Author  :   Leslie Mao
@Version :   1.0
@Contact :   leslie.mao@qq.com
@License :   (C)Copyright 2018-2019, Zhonglei Inc.
@Desc    :   None
"""


# here put the import lib
from openpyxl.styles import Border, Side, Alignment, Font

class HoaPhat:
        def format_data_line(self, ws, row, cols):
                ws.row_dimensions[row].height = 29
                for col in range(1, cols + 1):
                        c = ws.cell(row=row, column=col)
                        c.font = self.Data_Font
                        c.border = self.Data_Border
                        c.alignment = self.Data_Alignment
                        c.number_format = self.Data_Number_Format


        def format_footer_line(self, ws, row, cols):
                ws.row_dimensions[row].height = 30
                for col in range(1, cols + 1):
                        c = ws.cell(row=row, column=col)
                        c.font = self.Footer_Font
                        c.border = self.Footer_Border
                        c.alignment = self.Footer_Alignment
                        c.number_format = self.Footer_Number_Format

                ws.merge_cells(start_column=1, start_row=row, end_column=cols, end_row=row)


        Data_Font = Font(name='Times New Roman',
                        size=10.5,
                        bold=False,
                        italic=False,
                        vertAlign=None,
                        underline='none',
                        strike=False,
                        color='FF000000')

        Data_Border = Border(left=Side(border_style='thin', color='FF000000'),
                        right=Side(border_style='thin', color='FF000000'),
                        top=Side(border_style='thin', color='FF000000'),
                        bottom=Side(border_style='thin', color='FF000000'))

        Data_Alignment = Alignment(horizontal='center',
                                vertical='center',
                                text_rotation=0,
                                wrap_text=False,
                                shrink_to_fit=False,
                                indent=0)

        Data_Number_Format = 'General'

        Footer_Font = Font(name='宋体',
                        size=14,
                        bold=False,
                        italic=False,
                        vertAlign=None,
                        underline='none',
                        strike=False,
                        color='FF000000')

        Footer_Border = Border(left=Side(border_style=None, color='FF000000'),
                        right=Side(border_style=None, color='FF000000'),
                        top=Side(border_style=None, color='FF000000'),
                        bottom=Side(border_style=None, color='FF000000'))

        Footer_Alignment = Alignment(horizontal='center',
                                vertical='center',
                                text_rotation=0,
                                wrap_text=False,
                                shrink_to_fit=False,
                                indent=0)

        Footer_Number_Format = 'General'
